package com.lsl.command_pattern.commandUndo;

/**
 * description:使用命令模式实现撤销操作
 *
 * @author: liushengli
 * data: 2022/12/1
 */
public class Client {
    public static void main(String args[]) {
        CalculatorForm form = new CalculatorForm();
        AbstractCommand command = new ConcreteCommand();
        form.setCommand(command); //向发送者注入命令对象
        form.compute(10);
        form.compute(5);
        form.compute(10);
        form.undo();
    }
}